unit App.Form.TAppMainForm;

interface

uses
  Windows,
  Messages,
  SysUtils,
  Variants,
  Classes,
  Graphics,
  Controls,
  Forms,
  SmallStruct.Form.TSSForm,
  SmallStruct.Controller,
  SmallStruct.Controller.TSSController,
  SmallStruct.BusinessObject.TSSAdvancedBusinessObject,
  SmallStruct.Core,
  SmallStruct.Configuration;

type
  TAppMainForm = class(TSSForm)
    procedure FormCreate(Sender: TObject);
  private
    _Controller: ISSController;
  public
    procedure InitObject; override;
  end;

var
  AppMainForm: TAppMainForm;

implementation

{$R *.dfm}

{ TAppMainForm }

procedure TAppMainForm.FormCreate(Sender: TObject);
begin
  inherited;

  Width := 800;
  Height := 600;
end;

procedure TAppMainForm.InitObject;
var
  ControllerContext: TSSControllerContext;
  Paths5, PathPowerhrs: string;
begin
  inherited;
  _Controller := TSSController.Create(nil);
  ControllerContext := TSSControllerContext.Create(nil);
  ControllerContext.SetSystemObject(GetContext.GetParameter.GetObject('SYSTEM_OBJECT') as ISSSystemObject);
  _Controller.SetContext(ControllerContext);
  _Controller.InitObject;
//  Moidfy
  _Controller.AppendActionView('APP_MAIN_VIEW');

  (_Controller.GetObjectInstance as TWinControl).Parent := Self;
end;

end.
